#pragma once 
#include "Utils.h"

class Camera
{
private:
	D3DXVECTOR2 *_pTranslationVector2;
	D3DXVECTOR2 *_pCenterVector2;

	D3DXVECTOR2* getTranslationVector2();
	D3DXVECTOR2* getCenterVector2();
protected:
	Rect* _rect;
	Rect* _target;
public:
	D3DXMATRIX* _pMatrix;
	Camera(double x, double y, double width, double height) 
	{
		_target = NULL;

		_rect = new Rect(); 
		setXY(x, y); setWH(width, height);
		_pMatrix = new D3DXMATRIX;
		_pTranslationVector2 = new D3DXVECTOR2;
		_pCenterVector2 = new D3DXVECTOR2;
	}


	void setXY(double x, double y) { _rect->X = x; _rect->Y = y; }
	void setWH(double width, double height) { _rect->Width = width; _rect->Height = height; }

	double getX() { return _rect->X; }
	double getY() { return _rect->Y; }
	double getWidth() { return _rect->Width; }
	double getHeight() { return _rect->Height; }
	Rect* getRect() { return _rect; }

	void update();
	void setTarget(Rect* target) { _target = target; }
	D3DXMATRIX* getTransformMatrix();
};